package model;

/**
 *
 * @author Sonny Sandberg
 */
public class ZipCode 
{
    private String
            zipCode,
            city;

    public ZipCode(String zipCode, String city)
    {
        this.zipCode = zipCode;
        this.city = city;
    }

    public ZipCode()
    {
        reset();
    }
    
    public void reset()
    {
        zipCode = "";
        city = "";
    }

    public String getZipCode()
    {
        return zipCode;
    }

    public void setZipCode(String zipCode)
    {
        this.zipCode = zipCode;
    }

    public String getCity()
    {
        return city;
    }

    public void setCity(String city)
    {
        this.city = city;
    }
    
    public void clearModel()
    {
        zipCode = "";
        city = "";
    }
    
    public boolean isCompleted()
    {
        boolean answer = false;
        
        if (zipCode.length() > 0 && city.length() > 0)
        {
            answer = true;
        }
        
        return answer;
    }
    
    @Override
    public String toString()
    {
        String text = "";
        
        text = String.format("%s %s", zipCode, city);
        
        return text;
    }
}